//
//  TabView.m
//  demo3
//
//  Created by 张仕儒 on 2021/7/12.
//

#import "TabView.h"
@interface TabView()
@property (weak) IBOutlet TabView *tab;


@end


@implementation TabView

- (void)drawRect:(NSRect)dirtyRect {
    [super drawRect:dirtyRect];
    
    // Drawing code here.
}

+ (instancetype)initWithNibName:(NSString *)nibName{
    if (nibName == nil) {
        nibName = @"TabView";
    }
    NSNib *nib = [[NSNib alloc] initWithNibNamed:nibName bundle:nil];
    NSArray *objects = nil;
    BOOL isInitial = [nib instantiateWithOwner:self topLevelObjects:&objects];
    if (isInitial) {
        for (id obj in objects) {
            if([obj isKindOfClass:[TabView class]]) {
                TabView *view = (TabView *)obj;
                view.tab.delegate = view;
                return  view;
            }
        }
    }
    return nil;
}

//- (NSTabView *)
- (void)selectTabViewItemAtIndex:(NSInteger)index{
    
    
}
@end
